package org.fastsyncer.common.entity;

import java.util.HashMap;
import java.util.List;

/**
 * 驱动映射关系
 * 
 * @ClassName: MappingTask
 * @Description: 驱动映射配置，支持1对N驱动同步，主要包含数据源和多个目标源驱动
 * @author: YangPei
 * @date: 2017年7月12日 下午1:48:40
 */
public class MappingTask extends Task {

	private static final long serialVersionUID = 458010454337723960L;

	// 数据源驱动（当前）
	private Mapping sourceMapping;
	
	// 目标源驱动（当前）
	private Mapping targetMapping;

	// 驱动集合（待同步的目标源集合）
	private List<Mapping> mappings;

	// 过滤条件
	// "and":[{"name":"ID","operator":"equal","value":"111"},{"name":"ID","operator":"notEqual","value":"222"}]
	private HashMap<String, List<HashMap<String, String>>> query;

	// 策略
	private HashMap<String, HashMap<String, String>> policy;

	public Mapping getSourceMapping() {
		return sourceMapping;
	}

	public void setSourceMapping(Mapping sourceMapping) {
		this.sourceMapping = sourceMapping;
	}

	public Mapping getTargetMapping() {
		return targetMapping;
	}

	public void setTargetMapping(Mapping targetMapping) {
		this.targetMapping = targetMapping;
	}

	public List<Mapping> getMappings() {
		return mappings;
	}

	public void setMappings(List<Mapping> mappings) {
		this.mappings = mappings;
	}

	public HashMap<String, List<HashMap<String, String>>> getQuery() {
		return query;
	}

	public void setQuery(HashMap<String, List<HashMap<String, String>>> query) {
		this.query = query;
	}

	public HashMap<String, HashMap<String, String>> getPolicy() {
		return policy;
	}

	public void setPolicy(HashMap<String, HashMap<String, String>> policy) {
		this.policy = policy;
	}

	@Override
	public String toString() {
		return "MappingTask [sourceMapping=" + sourceMapping + ", targetMapping=" + targetMapping + ", mappings="
				+ mappings + ", query=" + query + ", policy=" + policy + "]";
	}

}
